<?php
/**
 * Created by PhpStorm.
 * User: R.Ice
 * Date: 2018/12/25
 * Time: 11:58
 * name:添加绩效提成配置
 * url:/erpAdministrativeFinance/add_achievement_config
 */

$oac_name            = $route->bodyParams['oac_name'];                    //提成名称
$oac_type            = $route->bodyParams['oac_type'];                    //提成方式 0-按单提成 1-金额提成
$oac_arithmetic      = $route->bodyParams['oac_arithmetic'];             //提成算法 用“|”隔开 例：1-10=20|11-25=40|26-50=70
$oac_arithmetic_text = $route->bodyParams['oac_arithmetic_text'];        //提成算法字符串 例：20/单（1-10）：40/单（11-25）：70/单（26-50）
$oac_oesid           = $route->bodyParams['oac_oesid'];                   //关联节点id
$oac_main_type       = $route->bodyParams['oac_main_type'];                   //
$oac_sales_percent   = $regexpObj->bodyV($response,$route,'oac_sales_percent','NORMAL');
$oac_teacher_percent = $regexpObj->bodyV($response,$route,'oac_teacher_percent','NORMAL');

//写入数组
$insertArr = [
    'oac_name'              => $oac_name,
    'oac_type'              => $oac_type,
    'oac_arithmetic'        => $oac_arithmetic,
    'oac_arithmetic_text'   => $oac_arithmetic_text,
    'oac_oesid'             => $oac_oesid,
    'oac_main_type'         => $oac_main_type,
    'oac_sales_percent'     => $oac_sales_percent,
    'oac_teacher_percent'   => $oac_teacher_percent,

];
//执行写入语句
$rsData = $db->mysqlDB->insert("oa_achievement_config",$insertArr);

//返回成功结果
$response->responseData( true, $rsData );